From 8022271e735cdeec1e842e79ce2d93e64cf0f35d Mon Sep 17 00:00:00 2001 From: "cl349@freefall.cl.cam.ac.uk" Date: Thu, 28 Oct 2004 14:47:21 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.297 (41810679UWr-FbiF6ilbN9cZPhKKUw) Remove timer selection code, don't use do_timer_interrupt_hook and use *_seq* functions on xtime_lock. Also remove asm-xen/asm-i386/timer.h which had no needed changes. --- .rootkeys | 2 - .../arch/xen/i386/kernel/time.c | 13 ++- .../arch/xen/i386/kernel/timers/Makefile | 2 +- .../asm-xen/asm-i386/mach-xen/do_timer.h | 83 ------------------- .../include/asm-xen/asm-i386/timer.h | 59 ------------- 5 files changed, 7 insertions(+), 152 deletions(-) delete mode 100644 linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/do_timer.h delete mode 100644 linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/timer.h diff --git a/.rootkeys b/.rootkeys index ddc5cd03b6..cc643a37c3 100644 --- a/.rootkeys +++ b/.rootkeys @@ -210,7 +210,6 @@ 40f5623akIoBsQ3KxSB2kufkbgONXQ linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/fixmap.h 4118b6a418gnL6AZsTdglC92YGqYTg linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/highmem.h 40f5623aJVXQwpJMOLE99XgvGsfQ8Q linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/io.h -40f5623am9BzluYFuV6EQfTd-so3dA linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/do_timer.h 40f5623aKXkBBxgpLx2NcvkncQ1Yyw linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/irq_vectors.h 40f5623aDMCsWOFO0jktZ4e8sjwvEg linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_post.h 40f5623arsFXkGdPvIqvFi3yFXGR0Q linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/setup_arch_pre.h @@ -229,7 +228,6 @@ 40f5623bG_LzgG6-qwk292nTc5Wabw linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/setup.h 40f5623bgzm_9vwxpzJswlAxg298Gg linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/synch_bitops.h 40f5623bVdKP7Dt7qm8twu3NcnGNbA linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/system.h -40f5623bSgGrvrGRpD71K-lIYqaGgg linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/timer.h 40f5623bc8LKPRO09wY5dGDnY_YCpw linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/tlbflush.h 41062ab7uFxnCq-KtPeAm-aV8CicgA linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/vga.h 40f5623bxUbeGjkRrjDguCy_Gm8RLw linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/xor.h diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c index d924f7a8e5..5ed85495cc 100644 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/time.c @@ -71,8 +71,6 @@ extern spinlock_t i8259A_lock; int pit_latch_buggy; /* extern */ -#include "do_timer.h" - u64 jiffies_64 = INITIAL_JIFFIES; EXPORT_SYMBOL(jiffies_64); @@ -86,7 +84,7 @@ spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED; spinlock_t i8253_lock = SPIN_LOCK_UNLOCKED; EXPORT_SYMBOL(i8253_lock); -struct timer_opts *cur_timer = &timer_none; +struct timer_opts *cur_timer = &timer_tsc; /* These are peridically updated in shared_info, and then copied here. */ u32 shadow_tsc_stamp; @@ -402,7 +400,9 @@ static inline void do_timer_interrupt(int irq, void *dev_id, while (delta >= NS_PER_TICK) { delta -= NS_PER_TICK; processed_system_time += NS_PER_TICK; - do_timer_interrupt_hook(regs); + do_timer(regs); + if (regs) + profile_tick(CPU_PROFILING, regs); } /* @@ -627,7 +627,6 @@ void __init time_init(void) wall_to_monotonic.tv_nsec = -xtime.tv_nsec; processed_system_time = shadow_system_time; - cur_timer = select_timer(); printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name); time_irq = bind_virq_to_irq(VIRQ_TIMER); @@ -679,7 +678,7 @@ void time_suspend(void) void time_resume(void) { unsigned long flags; - write_lock_irqsave(&xtime_lock, flags); + write_seqlock_irqsave(&xtime_lock, flags); /* Get timebases for new environment. */ __get_time_values_from_xen(); /* Reset our own concept of passage of system time. */ @@ -688,7 +687,7 @@ void time_resume(void) last_seen_tv.tv_sec = 0; /* Make sure we resync UTC time with Xen on next timer interrupt. */ last_update_from_xen = 0; - write_unlock_irqrestore(&xtime_lock, flags); + write_sequnlock_irqrestore(&xtime_lock, flags); } /* diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/Makefile b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/Makefile index f85f7de156..5b524a03c0 100644 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/Makefile +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/timers/Makefile @@ -5,7 +5,7 @@ XENARCH := $(subst ",,$(CONFIG_XENARCH)) obj-y := timer_tsc.o -c-obj-y := timer.o timer_none.o timer_pit.o +c-obj-y := c-link := diff --git a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/do_timer.h b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/do_timer.h deleted file mode 100644 index e79ce71c19..0000000000 --- a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/mach-xen/do_timer.h +++ /dev/null @@ -1,83 +0,0 @@ -/* defines for inline arch setup functions */ - -#include - -/** - * do_timer_interrupt_hook - hook into timer tick - * @regs: standard registers from interrupt - * - * Description: - * This hook is called immediately after the timer interrupt is ack'd. - * It's primary purpose is to allow architectures that don't possess - * individual per CPU clocks (like the CPU APICs supply) to broadcast the - * timer interrupt as a means of triggering reschedules etc. - **/ - -static inline void do_timer_interrupt_hook(struct pt_regs *regs) -{ - do_timer(regs); -/* - * In the SMP case we use the local APIC timer interrupt to do the - * profiling, except when we simulate SMP mode on a uniprocessor - * system, in that case we have to call the local interrupt handler. - */ -#ifndef CONFIG_X86_LOCAL_APIC - if (regs) - profile_tick(CPU_PROFILING, regs); -#else - if (regs && !using_apic_timer) - smp_local_timer_interrupt(regs); -#endif -} - - -/* you can safely undefine this if you don't have the Neptune chipset */ - -#define BUGGY_NEPTUN_TIMER - -/** - * do_timer_overflow - process a detected timer overflow condition - * @count: hardware timer interrupt count on overflow - * - * Description: - * This call is invoked when the jiffies count has not incremented but - * the hardware timer interrupt has. It means that a timer tick interrupt - * came along while the previous one was pending, thus a tick was missed - **/ -static inline int do_timer_overflow(int count) -{ - int i; - - spin_lock(&i8259A_lock); - /* - * This is tricky when I/O APICs are used; - * see do_timer_interrupt(). - */ - i = inb(0x20); - spin_unlock(&i8259A_lock); - - /* assumption about timer being IRQ0 */ - if (i & 0x01) { - /* - * We cannot detect lost timer interrupts ... - * well, that's why we call them lost, don't we? :) - * [hmm, on the Pentium and Alpha we can ... sort of] - */ - count -= LATCH; - } else { -#ifdef BUGGY_NEPTUN_TIMER - /* - * for the Neptun bug we know that the 'latch' - * command doesn't latch the high and low value - * of the counter atomically. Thus we have to - * substract 256 from the counter - * ... funny, isnt it? :) - */ - - count -= 256; -#else - printk("do_slow_gettimeoffset(): hardware timer problem?\n"); -#endif - } - return count; -} diff --git a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/timer.h b/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/timer.h deleted file mode 100644 index e478d7dfdb..0000000000 --- a/linux-2.6.9-xen-sparse/include/asm-xen/asm-i386/timer.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef _ASMi386_TIMER_H -#define _ASMi386_TIMER_H - -/** - * struct timer_ops - used to define a timer source - * - * @name: name of the timer. - * @init: Probes and initializes the timer. Takes clock= override - * string as an argument. Returns 0 on success, anything else - * on failure. - * @mark_offset: called by the timer interrupt. - * @get_offset: called by gettimeofday(). Returns the number of microseconds - * since the last timer interupt. - * @monotonic_clock: returns the number of nanoseconds since the init of the - * timer. - * @delay: delays this many clock cycles. - */ -struct timer_opts{ - char* name; - int (*init)(char *override); - void (*mark_offset)(void); - unsigned long (*get_offset)(void); - unsigned long long (*monotonic_clock)(void); - void (*delay)(unsigned long); -}; - -#define TICK_SIZE (tick_nsec / 1000) - -extern struct timer_opts* select_timer(void); -extern void clock_fallback(void); -void setup_pit_timer(void); - -/* Modifiers for buggy PIT handling */ - -extern int pit_latch_buggy; - -extern struct timer_opts *cur_timer; -extern int timer_ack; - -/* list of externed timers */ -extern struct timer_opts timer_none; -extern struct timer_opts timer_pit; -extern struct timer_opts timer_tsc; -#ifdef CONFIG_X86_CYCLONE_TIMER -extern struct timer_opts timer_cyclone; -#endif -extern struct timer_opts timer_xen; - -extern unsigned long calibrate_tsc(void); -extern void init_cpu_khz(void); -#ifdef CONFIG_HPET_TIMER -extern struct timer_opts timer_hpet; -extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr); -#endif - -#ifdef CONFIG_X86_PM_TIMER -extern struct timer_opts timer_pmtmr; -#endif -#endif -- 2.30.2